package cn.bluarry.donationuser.pojo;


import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;

import java.util.Date;
import java.util.Map;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name="Donation_User")
public class Donation_User {
    private static final long serialVersionUID = 1L;

    @Column(name = "UserId" ,type = MySqlTypeConstant.VARCHAR , length = 64,isKey = true)
    private String UserId;
    @Column(name = "UserName" ,type = MySqlTypeConstant.VARCHAR , length = 64,isNull = false)
    private String UserName;
    @Column(name = "DisplayName" ,type = MySqlTypeConstant.VARCHAR , length = 128)
    private String DisplayName;
    @Column(name = "Email" ,type = MySqlTypeConstant.VARCHAR , length = 128)
    private String Email;
    @Column(name = "MobilePhone" ,type = MySqlTypeConstant.VARCHAR , length = 18)//考虑到区号
    private String MobilePhone;
    @Column(name = "Comments" ,type = MySqlTypeConstant.VARCHAR , length = 128)
    private String Comments;
    @Column(name = "CreateDate" ,type = MySqlTypeConstant.TIMESTAMP )
    private Date CreateDate;
    @Column(name = "UpdateDate" ,type = MySqlTypeConstant.TIMESTAMP )
    private Date UpdateDate;

    public Donation_User(String UserId, String UserName, String DisplayName, String Email, String MobilePhone, String Comments, Date CreateDate, Date UpdateDate) {
        this.UserId = UserId;
        this.UserName = UserName;
        this.DisplayName = DisplayName==null?"":DisplayName;
        this.Email = Email==null?"":Email;
        this.MobilePhone = MobilePhone==null?"":MobilePhone;
        this.Comments = Comments==null?"":Comments;
        this.CreateDate = CreateDate;
        this.UpdateDate = UpdateDate;
    }
    public Donation_User(Map<String,String> m, Date date){
        this.UserName= m.get("UserName");
        this.UserId = m.get("UserId");
        this.DisplayName = m.get("DisplayName")==null?"":m.get("DisplayName");
        this.Email = m.get("Email")==null?"":m.get("Email");
        this.MobilePhone = m.get("MobilePhone")==null?"":m.get("MobilePhone");
        this.Comments = m.get("Comments")==null?"":m.get("Comments");
        this.CreateDate = date;
        this.UpdateDate = null;
    }
    public Donation_User() {
        super();
    }

    @JsonProperty("UserId")
    public String getUserId() {
        return UserId;
    }

    public void setUserId(String UserId) {
        this.UserId = UserId;
    }

    @JsonProperty("UserName")
    public String getUserName() {
        return UserName;
    }

    public void setUserName(String UserName) {
        this.UserName = UserName;
    }

    @JsonProperty("DisplayName")
    public String getDisplayName() {
        return DisplayName;
    }

    public void setDisplayName(String DisplayName) {
        this.DisplayName = DisplayName;
    }

    @JsonProperty("Email")
    public String getEmail() {
        return Email;
    }

    public void setEmail(String Email) {
        this.Email = Email;
    }

    @JsonProperty("MobilePhone")
    public String getMobilePhone() {
        return MobilePhone;
    }

    public void setMobilePhone(String MobilePhone) {
        this.MobilePhone = MobilePhone;
    }

    @JsonProperty("Comments")
    public String getComments() {
        return Comments;
    }

    public void setComments(String Comments) {
        this.Comments = Comments;
    }

    @JsonProperty("CreateDate")
    public Date getCreateDate() {
        return CreateDate;
    }

    public void setCreateDate(Date CreateDate) {
        this.CreateDate = CreateDate;
    }

    @JsonProperty("UpdateDate")
    public Date getUpdateDate() {
        return UpdateDate;
    }

    public void setUpdateDate(Date UpdateDate) {
        this.UpdateDate = UpdateDate;
    }
}
